<template>
  <div class="hello">
    <a href="#/index/731850063">index</a> 
    <a href="#/success">success</a> 


    <div class="app">
      <label class="app-label" >企业税号</label>
      <input class="app-input" placeholder="请填写企业税号" type="text" v-model="id" >
    </div>
    <br>
    <div class="btn-group">
      <button class="app-btns" :class="{'disabled':disabled}" @click="submit($event)" >确定</button>
      <br>  
      <button class="app-btns" :class="{'disabled':disabled}" @click="chaxun($event)" >查询</button>
    </div>

  </div>
</template>

<script>
  import { XInput ,XButton,Cell} from 'vux'

export default {
  name: 'hello',
  components:{
    XInput ,XButton,Cell
  },
  data () {
    return {
      id:'',
      msg: 'Welcome to Your Vue.js App'
    }
  },
  computed:{
		disabled(){
		  return  !this.id ?true:false;
		}
  },
  methods: {
    submit:function() {  
      if(this.id !=''){
        this.$router.push({path:'/index/'+this.id})
      }else{
        this.$vux.toast.show({
          type:'text',
          width:'70%',
          text: '请输入企业税号'
        })
      }
    },
    chaxun:function() {  
      if(this.id !=''){
        this.$router.push({path:'/chaxun/'+this.id})
      }else{
        this.$vux.toast.show({
          type:'text',
          width:'70%',
          text: '请输入企业税号'
        })
      }
    }

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

a {
  color: #42b983;
}
.app{
  background: #FFFFFF;
  line-height: 40px;
  font-size: 14px;
  padding:10px;
      position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}
.app-label{
    display: block;
    width: 105px;
    word-wrap: break-word;
    word-break: break-all;
}
.app-input{
    width: 100%;
    border: 0;
    outline: 0;
    -webkit-appearance: none;
    background-color: transparent;
    font-size: inherit;
    color: inherit;
    height: 1.41176471em;
    line-height: 1.41176471;
        -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
}
.btn-group{
  width: 95%;
  margin: 0 auto;
}
.btn-group .disabled{
  background: #9ED99D;

}
.app-btns{
  position: relative;
  display: block;
  width: 100%;
  border: 0 none;
  background:  #1AAD19;
  box-sizing: border-box;
  font-size: 18px;
  outline: none;
  text-align: center;
  text-decoration: none;
  color: #FFFFFF;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: 5px;
  overflow: hidden;
  line-height: 2.2
}
</style>
